import request from '@/content/utils/request'

const getAllUserLessonFile = (data) => {
    return request({
        url: '/usermeta/getAllUserLessonFile',
        method: 'post',
        data,
    })
}

const createUserBookRecord = (data) => {
    return request({
        url: '/usermeta/createUserBookRecord',
        method: 'post',
        data,
    })
}

const syncUserResRecord = (data) => {
    return request({
        url: '/usermeta/syncUserResRecord',
        method: 'post',
        data,
    })
}

const createUserFile = (data) => {
    return request({
        url: '/usermeta/createUserFile',
        method: 'post',
        data,
    })
}

const getUserLessonMeta = (data) => {
    return request({
        url: '/usermeta/getUserLessonMeta',
        method: 'post',
        data,
    })
}

const deleteUserFile = (data) => {
    return request({
        url: '/usermeta/deleteUserFile',
        method: 'post',
        data,
    })
}

const deleteUserLessonMeta = (data) => {
    return request({
        url: '/usermeta/deleteUserLessonMeta',
        method: 'post',
        data,
    })
}

const creatUserLessonMeta = (data) => {
    return request({
        url: '/usermeta/creatUserLessonMeta',
        method: 'post',
        data,
    })
}

const createUserResRecord = (data) => {
    return request({
        url: '/usermeta/createUserResRecord',
        method: 'post',
        data,
    })
}

const recordUseTechTool = (data) => {
    return request({
        url: '/user/recordUseTechTool',
        method: 'post',
        data,
    })
}

//查询当前用户所有的主题及课程信息
const getAllDiyLessons = (data) => {
    return request({
        url: '/usermeta/getAllDiyLessons',
        method: 'post',
        data,
    })
}

//创建自定义课程科目主题
const createUserSubject = (data) => {
    return request({
        url: '/usermeta/createUserSubject',
        method: 'post',
        data,
    })
}

//编辑自定义课程科目主题
const editUserSubject = (data) => {
    return request({
        url: '/usermeta/editUserSubject',
        method: 'post',
        data,
    })
}


//编辑自定义课程
const editUserDiyLesson = (data) => {
    return request({
        url: '/usermeta/editUserDiyLesson',
        method: 'post',
        data,
    })
}

//删除自定义课程科目主题
const delUserSubject = (data) => {
    return request({
        url: '/usermeta/delUserSubject',
        method: 'post',
        data,
    })
}

//创建自定义课程
const createUserDiyLesson = (data) => {
    return request({
        url: '/usermeta/createUserDiyLesson',
        method: 'post',
        data,
    })
}

//删除自定义课程
const delUserDiyLesson = (data) => {
    return request({
        url: '/usermeta/delUserDiyLesson',
        method: 'post',
        data,
    })
}


export default {
    getAllUserLessonFile,
    syncUserResRecord,
    createUserFile,
    getUserLessonMeta,
    deleteUserFile,
    deleteUserLessonMeta,
    creatUserLessonMeta,
    createUserResRecord,
    recordUseTechTool,
    createUserBookRecord,
    createUserSubject,
    getAllDiyLessons,
    editUserSubject,
    delUserSubject,
    createUserDiyLesson,
    delUserDiyLesson,
    editUserDiyLesson,
}
